import { useSelector } from 'umi';
function useConnect(moudle) {
  let state = {};
  if (Array.isArray(moudle)) {
    //   传数组
    moudle.forEach((item) => {
      // item 是 每一项模块名
      state[item] = useSelector((state) => state[item]);
    });
  } else {
    // 传字符串
    state = useSelector((state) => state[moudle]);
  }

  return state;
}
export default useConnect;
